﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;

using ServicesComponent.Repositories.Core;
using Business_Objects;
using Data_Objects;
namespace ServicesComponent.Repositories
{
    ///// <summary>
    ///// DonViTinh Repository. Good example of CRUD operations.
    ///// </summary>
    public class DonViTinhRepository : IDonViTinhRepository
    {
        private static readonly IDonViTinhDao _donViTinh = DataAccess.DonViTinhDao;
        public List<DonViTinh> GetList()
        {
            return _donViTinh.GetDonViTinh().ToList();
        }

        public DonViTinh Get(string id)
        {
            return _donViTinh.GetDonViTinhByID(id);
        }

        public void Insert(DonViTinh t)
        {
            _donViTinh.InsertDonViTinh(t);
        }

        public void Update(DonViTinh t)
        {
            _donViTinh.UpdateDonViTinh(t);
        }

        public void Delete(DonViTinh t)
        {
            _donViTinh.DeleteDonViTinh(t);
        }
    }
}